home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Audio, Video & Photo
/
MediaCoder 0.6.2.4200
/
MediaCoder-0.6.2.4200.exe
/
extensions
/
MPEG.7z
/
main.js
< prev
Wrap
Text File
|
2007-04-03
|
2KB
|
62 lines
/*************************************************************************
* MediaCoder extension - MPEG Maker
* Distributed under GPL license
* Copyright (c) 2005-06 Stanley Huang <reachme@citiz.net>
* All rights reserved.
*************************************************************************/
function ApplyParams()
{
var doc = NewXML("MediaCoderPrefs");
if (!doc) {
alert("Error creating config XML");
return;
}
// container settings
var vidfmt = document.getElementById("vidfmt").value;
AddPrefNode(doc, "overall.container.format", vidfmt);
// video settings
AddPrefNode(doc, "overall.video.format", vidfmt);
AddPrefNode(doc, "overall.video.bitrate", document.getElementById("vb").value);
var fps = document.getElementById("fps").value.split("/");
if (fps.length < 2) {
AddPrefNode(doc, "videofilter.frame.fps", fps[0]);
AddPrefNode(doc, "videofilter.frame.fpsScale", "1");
} else {
AddPrefNode(doc, "videofilter.frame.fps", fps[0]);
AddPrefNode(doc, "videofilter.frame.fpsScale", fps[1]);
}
var res = document.getElementById("res").value.split("x");
AddPrefNode(doc, "videofilter.scale.enabled", (res[0] != "0"));
AddPrefNode(doc, "videofilter.scale.width", res[0]);
AddPrefNode(doc, "videofilter.scale.height", res[1]);
// audio settings
var audfmt = document.getElementById("audfmt").value;
switch (audfmt) {
case "No Audio":
AddPrefNode(doc, "overall.audio.encoder", audfmt);
break;
default:
AddPrefNode(doc, "overall.audio.encoder", "ffmpeg");
AddPrefNode(doc, "audioenc.ffmpeg.codec", audfmt);
AddPrefNode(doc, "audioenc.ffmpeg.bitrate", document.getElementById("ab").value);
AddPrefNode(doc, "audioenc.ffmpeg.streams", document.getElementById("streams").value);
break;
}
AddPrefNode(doc, "audiofilter.resample.samplerate", document.getElementById("srate").srate);
// post settings to MediaCoder
PostPrefXML(doc);
}
function Unload()
{
// stop playback on window close
SendCommand("stop_play");
}